Make systemd unit configurable and fix :system-mode defaults#6
Open
floriancrusius wants to merge 1 commit into
Open
Make systemd unit configurable and fix :system-mode defaults#6floriancrusius wants to merge 1 commit into
floriancrusius wants to merge 1 commit into
Conversation
- Add :solid_queue_service_unit_env_files / :solid_queue_service_unit_env_vars for injecting EnvironmentFile= and Environment="KEY=VALUE" lines into the unit (inspired by capistrano-sidekiq). Both fall back to shared :service_unit_env_files / :service_unit_env_vars. - Add :solid_queue_command (default "rake solid_queue:start") so setups on SolidQueue >= 0.4 can switch to "bin/jobs" without templating. - Fix WantedBy: multi-user.target when running in :system mode (previously always default.target, which prevented boot activation of system units). - Fix :system mode running the service implicitly as root — now uses :solid_queue_user (falls back to :run_as, then :user). - Drop implicit rendering of Capistrano's default_env and the hardcoded MALLOC_ARENA_MAX=2; pass anything you need explicitly via the new hooks. RAILS_ENV is still derived from the current stage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
:solid_queue_service_unit_env_filesand:solid_queue_service_unit_env_vars(inspired bycapistrano-sidekiq). Both fall back to shared:service_unit_env_files/:service_unit_env_varsso multi-plugin setups can share one source.:solid_queue_command(default"rake solid_queue:start") so SolidQueue >= 0.4 setups can switch to"bin/jobs"without templating.[Install] WantedBy=— nowmulti-user.targetin:systemmode (previously alwaysdefault.target, which prevented boot activation of system units).:systemmode running as root — now rendersUser=<solid_queue_user>(defaults to:run_as, then Capistrano's:user).default_envis no longer auto-rendered into the unit;MALLOC_ARENA_MAX=2is no longer hardcoded. Pass what you need explicitly via the new hooks.RAILS_ENVis still derived from the current stage.Test plan
bundle exec cap <stage> solid_queue:generateand inspect the generatedsolid_queue.service— verifyEnvironment=,EnvironmentFile=,ExecStart=,User=,WantedBy=look correct in both:userand:systemmodes.bundle exec cap <stage> solid_queue:installon a staging host,systemctl --user status <unit>(orsudo systemctl status …for:system) — service comes up.:solid_queue_service_unit_env_vars, ["FOO=bar"]and confirm it lands in the rendered unit.:solid_queue_command, "bin/jobs"on a SolidQueue-0.4+ app and confirm the process starts.